package com.wuyan.locationdog.adapter

import android.view.View
import android.widget.TextView
import androidx.annotation.LayoutRes
import com.arcsoft.commonbase.ext.gone
import com.arcsoft.commonbase.ext.visible
import com.blankj.utilcode.util.SizeUtils
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.wuyan.locationdog.R
import com.wuyan.locationdog.util.HourMinuteConverter


class VoiceTimeListAdapter(@LayoutRes layoutResId: Int, data: MutableList<String>?) :
    BaseQuickAdapter<String, BaseViewHolder>(layoutResId, data) {


    override fun convert(holder: BaseViewHolder, item: String) {
        holder.apply {
            holder.apply {
                if (holder.layoutPosition == 1) {
                    getView<View>(R.id.left).visible()
                } else {
                    getView<View>(R.id.left).gone()

                }

                if (holder.layoutPosition == data.size) {
                    getView<View>(R.id.right).visible()
                } else {
                    getView<View>(R.id.right).gone()

                }
                getView<TextView>(R.id.time).text = HourMinuteConverter.convertSecondsToMinutesAndSeconds(item.toInt())
            }
        }
    }
}


